{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1479
  Verdict: Accepted
}
var a,b:integer;
begin
Assign(input,'input.txt');
Assign(output,'output.txt');
reset(input);
rewrite(output);
readln(a,b);
writeln((b-1) div a+1,' ',(b-1) mod a+1);
end.